cmake_minimum_required(VERSION 3.00)
project(Compiler)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# set(CMAKE_BUILD_TYPE "Debug")

add_definitions(
        -DLEX_KEYWORD_UPPERCASE           # 词法分析包含大写字母
        # -DRELATIONAL_OPERATOR_ONLY_BINARY # 关系运算符仅为二元式
        -DERRORINFO_STDERR                # 向标准出错输出错误信息
        -DSYN_SAVE_TO_DYS_BYLINE          # 语法分析逐行生成二元式到 .dys
)

add_executable(Compiler main.cpp
        1-LexAnalysis/LexAnalysis.hpp
        1-LexAnalysis/LexAnalysis.cpp
        1-LexAnalysis/StatePattern.hpp
        1-LexAnalysis/Tokenizer.cpp
        1-LexAnalysis/TokenState.cpp
        2-SyntaxAnalysis/SyntaxAnalysis.hpp
        2-SyntaxAnalysis/SyntaxAnalysis.cpp
        2-SyntaxAnalysis/SyntaxTree.cpp
)
